<?php

namespace Database\Factories;

use App\Models\Bookmark;
use Illuminate\Database\Eloquent\Factories\Factory;

class BookmarkFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = Bookmark::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'user_id' => $this->faker->numberBetween(0, 10), // 生成随机整数0——100之间
            'title' => $this->faker->sentence(5, true), // 返回一个句子 5个左右单词
            'url' => $this->faker->url, // 返回一个随机url
            'category_id' => $this->faker->numberBetween(0, 10),
            'summary' => $this->faker->paragraph(3, true), //返回一个段落，由3条左右的句子组成
            'status' => $this->faker->randomElement([-2, -1, 0, 1, 2]), // 随机返回数组中的一个元素
        ];
    }
}
